#include <iostream>
#include <vector>
using namespace std;
bool findValue(vector<int>::iterator begin, vector<int>::iterator end, int value) {
    for (auto it = begin; it != end; ++it) {
        if (*it == value) {
            return true;
        }
    }
    return false;
}
int main() {
    vector<int> vec = {1, 2, 3, 4, 5};
    bool found = findValue(vec.begin(), vec.end(), 5);
    if (found) {
        cout << "Value found in the vector." << endl;
    } else {
        cout << "Value not found in the vector." << endl;
    }
    vector<int>::iterator start = vec.begin() + 1;
    vector<int>::iterator stop = vec.end() - 1;
    found = findValue(start, stop, 10);
    if (found) {
        cout << "Value found in the specified range." << endl;
    } else {
        cout << "Value not found in the specified range." << endl;
    }
    return 0;
}